home *** CD-ROM | disk | FTP | other *** search
- #ifndef OPAL_LOADSAVE_H
- #define OPAL_LOADSAVE_H
-
- #ifndef EXEC_TYPES_H
- #include "exec/types.h"
- #endif
-
- #ifndef EXEC_PORTS_H
- #include "exec/ports.h"
- #endif
-
- #ifndef LIBRARIES_DOS_H
- #include "libraries/dos.h"
- #endif
-
-
- #define OVLOADERPORT "OVLoader_Port"
- #define OVSAVERPORT "OVSaver_Port"
-
-
- /* Loader Saver Interface Message */
-
- struct LSIMessage
- { struct Message lsi_Node; /* Standard Message Node */
- ULONG lsi_Type; /* Command Type */
- ULONG lsi_SubType; /* Command SubType */
- ULONG lsi_Flags; /* See below */
- SHORT lsi_X; /* Horizontal pixel offset */
- SHORT lsi_Y; /* Vertical pixel offset */
- SHORT lsi_Width; /* Image Width */
- SHORT lsi_Height; /* Image Height */
- SHORT lsi_Depth; /* Image Depth */
- SHORT lsi_Resolution; /* Opal image resolution flags */
- UBYTE *lsi_Planes[24]; /* BitPlane pointers */
- ULONG lsi_Result; /* Command Result */
- BPTR lsi_File; /* File handle */
- char *lsi_FileName; /* File name being loaded */
- struct OpalScreen *lsi_OScrn; /* OpalScreen as Source or Dest */
- LONG lsi_DataLength; /* Misc data length */
- APTR lsi_Address; /* Misc pointer */
- };
-
-
-
- #define LSICmd(dp,sp,m) {PutMsg(dp,(struct Message *)m);WaitPort(sp);GetMsg(sp);}
-
- /* Message (Command) Types */
-
- #define OVCMD_FORMATCHECK 0
- #define OVCMD_LOADIMAGE 1
- #define OVCMD_SAVEIMAGE 2
- #define OVCMD_EXPUNGE 3
- #define OVCMD_SENDDATA 4
- #define OVCMD_GETDATA 5
- #define OVCMD_ERROR 6
- #define OVCMD_DONE 7
- #define OVCMD_SETPALETTE 8
- #define OVCMD_GETPALETTE 9
- #define OVCMD_SETCLUT 10
- #define OVCMD_GETCLUT 11
- #define OVCMD_PARAMETERS 12
- #define OVCMD_GETTHUMBNAIL 13
-
-
-
- /* Application specific messages */
- #define OVCMD_USERMESSAGE 50
- #define OVCMD_ASKUSER 51
- #define OVCMD_PERCENTAGE 52
- #define OVCMD_BUILDREQUEST 53
-
-
- /* Data Format for lsi_SubTypes */
- /* note: x offset must be 0 for PLANAR and ILBM subtypes */
- /* If the image has a palette, it MUST be sent first */
-
- #define OVDF_PLANAR 0 /* Standard bit planes [1..24] */
- #define OVDF_RGB 1 /* Three seperate R,G,B channels (bytes)*/
- #define OVDF_GREY 2 /* 8bit grey scale values stored as bytes*/
- #define OVDF_ILBM 3 /* Interleaved bitmap format */
- #define OVDF_ALPHA 4 /* 8bit alpha data (byte per pixel) */
- #define OVDF_STENCIL 5 /* 1bitplane stencil mask */
-
-
- /* Flags for lsi_Flags valid in a OVCMD_LOADIMAGE and OVCMD_SAVEIMAGE message */
- #define LSIF_ALPHA 2 /* Load/Save Alpha Plane */
- #define LSIF_STENCIL 4 /* Load/Save Stencil Plane */
- #define LSIF_IMAGEDATA 8 /* Load/Save Image data */
-
- /* Flags for OVCMD_FormatCheck */
- #define LSIF_HASIMAGE 1 /* Image has Image data */
- #define LSIF_HASSTENCIL 2 /* Image has stencil data */
- #define LSIF_HASALPHA 4 /* Image has Alpha channel data */
- #define LSIF_RESVALID 8 /* Resolution flags are valid (load only)*/
-
-
- /* Error Codes, returned in lsi_Result of a OVCMD_ERROR message */
-
- #define LSI_ERR_OUTOFMEM 1
- #define LSI_ERR_OPENFILE 2
- #define LSI_ERR_BADFORMAT 3
- #define LSI_ERR_FILEREAD 4
- #define LSI_ERR_FILEWRITE 5
- #define LSI_ERR_UNSUPPORTED 6
- #define LSI_ERR_ERROR 100 /* General error */
-
-
- /* List structure for opal.library's list of LSI modules */
-
- struct LSIListEntry
- { struct LSIListEntry *Succ;
- struct LSIListEntry *Pred;
- struct MsgPort *Port;
- ULONG Flags;
- char Name[30];
- };
-
-
- /* Loader Flags */
- #define OVLF_ALLOWIMAGE 1 /* File format handles Image data */
- #define OVLF_ALLOWSTENCIL 2 /* File format handles a stencil plane */
- #define OVLF_ALLOWALPHA 4 /* File format handles Alpha data */
- #define OVLF_NEEDFILENAME 8 /* Needs a filename */
-
- /* Saver Flags */
- #define OVSF_ALLOWIMAGE 1 /* File format handles Image data */
- #define OVSF_ALLOWSTENCIL 2 /* File format handles a stencil plane */
- #define OVSF_ALLOWALPHA 4 /* File format handles Alpha data */
- #define OVSF_NEEDFILENAME 8 /* Needs a filename */
-
- #endif
-
-